<!--
 * @Descripttion: 大二一名学习前端开发的计科学生，缓慢成长中！
 * @emial: 2392862431@qq.com
 * @Author: SummerSofts
 * @Date: 2023-09-06 20:59:08
 * @LastEditors: SummerSofts
 * @LastEditTime: 2023-09-11 20:37:07
-->
<template>
    <div id="copy_text" data-clipboard-text="<wmIcon></wmIcon>" @click="handleCopy">
        <wmIcon></wmIcon>
    </div>
</template>


<script setup>
import { ref, reactive, onMounted } from "vue"
import Clipboard from "clipboard"
import { wmIcon } from "warmheart-design"
const handleCopy = () => {
    let clipboard = new Clipboard("#copy_text");
    clipboard.on("success", (e) => {
        alert("复制成功！")
        clipboard.destroy(); // 释放内存
    });
    clipboard.on("error", (e) => {
        // 不支持复制
        alert("复制失败，不支持！")
        clipboard.destroy(); // 释放内存
    });

}
</script>


<style lang="less" scoped></style>
